{volist name="$addonFieldExtList" id="vo"}
    {if (isset($vo.ifeditable) || $vo.ifeditable) && ($vo.ifsystem == 0)}
        {switch name="vo.dtype"}

            {case value="hidden"}
                <!-- 隐藏域 start -->
                <div class="layui-form-item none">
                    <label class="layui-form-label">{$vo.title}</label>
                    <div class="layui-input-inline pcfcms_layui-input-inline">
                        <input type="hidden" class="layui-input" id="{$vo.fieldArr}_{$vo.name}" name="{$vo.fieldArr}[{$vo.name}]" value="{$vo.dfvalue}">
                    </div>
                </div>
                <!-- 隐藏域 start -->
            {/case}

            {case value="text"}
                <!-- 单行文本框 start -->
                <div class="layui-form-item">
                    <label class="layui-form-label">{$vo.title}</label>
                    <div class="layui-input-inline pcfcms_layui-input-inline">
                        <input type="text" class="layui-input" id="{$vo.fieldArr}_{$vo.name}" name="{$vo.fieldArr}[{$vo.name}]" value="{$vo.dfvalue}">
                    </div>
                </div>
                <!-- 单行文本框 end -->
            {/case}

            {case value="multitext"}
                <!-- 多行文本框 start -->
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">{$vo.title}</label>
                    <div class="layui-input-inline pcfcms_layui-input-inline">
                        <textarea id="{$vo.fieldArr}_{$vo.name}" name="{$vo.fieldArr}[{$vo.name}]" class="layui-textarea">{$vo.dfvalue}</textarea>
                    </div>
                </div>
                <!-- 多行文本框 end -->
            {/case}

            {case value="checkbox"}
                <!-- 复选框 start -->
                <div class="layui-form-item">
                    <label class="layui-form-label">{$vo.title}</label>
                    <div class="layui-input-inline pcfcms_layui-input-inline">
                        {volist name="$vo.dfvalue" id="v2"}
                        <input type="checkbox" lay-skin="primary" lay-filter="addonFieldExt" name="{$vo.fieldArr}[{$vo.name}][]" data-callback="func_{$vo.name}_pcfempty" value="{$v2}" {if condition="isset($vo['trueValue']) AND in_array($v2, $vo['trueValue'])"}checked="checked"{/if} title="{$v2}">
                        {/volist}
                        <input type="hidden" name="{$vo.fieldArr}[{$vo.name}_pcfempty]" value="{if condition="!empty($vo['trueValue'])"}1{else/}0{/if}">
                    </div>
                </div>
                <script type="text/javascript">
                    function func_{$vo.name}_pcfempty(){
                        var len = $("input[name='{$vo.fieldArr}[{$vo.name}][]']:checked").length;
                        $("input[name='{$vo.fieldArr}[{$vo.name}_pcfempty]']").val(len);
                    }
                </script>
                <!-- 复选框 end -->
            {/case}

            {case value="radio"}
                <!-- 单选项 start -->
                <div class="layui-form-item">
                    <label class="layui-form-label">{$vo.title}</label>
                    <div class="layui-input-inline pcfcms_layui-input-inline">
                        {volist name="$vo.dfvalue" id="v2"}
                        <input type="radio" id="{$vo.fieldArr}_{$vo.name}" name="{$vo.fieldArr}[{$vo.name}]" value="{$v2}" {if condition="isset($vo['trueValue']) AND in_array($v2, $vo['trueValue'])"}checked="checked"{/if} title="{$v2}">
                        {/volist}
                    </div>
                </div>
                <!-- 单选项 end -->
            {/case}

            {case value="switch"}
                <!-- 开关 start -->
                <div class="layui-form-item">
                    <label class="layui-form-label">{$vo.title}</label>
                    <div class="layui-input-inline pcfcms_layui-input-inline">
                        <input type="checkbox" id="{$vo.fieldArr}[{$vo.name}]" lay-filter="{$vo.fieldArr}[{$vo.name}]" lay-skin="switch" lay-text="是|否" {if condition="0 != $vo['dfvalue']"}value="1" checked {/if}>
                        <input type="hidden" name="{$vo.fieldArr}[{$vo.name}]" value="{$vo.dfvalue|default='0'}" />
                    </div>
                </div>
                <!-- 开关 end -->
            {/case}

            {case value="select"}
                <!-- 下拉框 start -->
                <div class="layui-form-item">
                    <label class="layui-form-label">{$vo.title}</label>
                    <div class="layui-input-inline">
                        <select name="{$vo.fieldArr}[{$vo.name}]" id="{$vo.fieldArr}_{$vo.name}">
                            {volist name="$vo.dfvalue" id="v2"}
                            <option value="{$v2}" {if condition="isset($vo['trueValue']) AND in_array($v2, $vo['trueValue'])"}selected{/if}>{$v2}</option>
                            {/volist}
                        </select>
                    </div>
                </div>
                <!-- 下拉框 end -->
            {/case}

            {case value="img"}
                <!-- 单张图 start -->
                <div class="layui-form-item">
                  <label class="layui-form-label">{$vo.title}</label>
                  <div class="layui-input-inline auto">
                    <ul class="layout">
                      <li>
                       <input name="{$vo.fieldArr}[{$vo.name}_gzpcf_local]" id="{$vo.fieldArr}_{$vo.name}_gzpcf_local" placeholder="图片地址" value="{$vo[$vo['name'].'_gzpcf_local']}" class="layui-input">
                        <img id="img_{$vo.fieldArr}_{$vo.name}_gzpcf_local" src="{$vo[$vo['name'].'_gzpcf_local']|get_default_pic=###}" class="none">
                      </li>
                      <li style="margin-top:3px;margin-left:5px;">
                        <div class="layui-btn-group">
                          <input type="button" value="上传图片" class="layui-btn layui-btn-sm pcfcms-upload" lay-data="{number:1,pcf_inputId:'{$vo.fieldArr}_{$vo.name}_gzpcf_local',pcf_savepath:'allimg'}">
                          <input type="button" value="选择图片" class="layui-btn layui-btn-sm" onClick="GetPictureFolder(1,'{$vo.fieldArr}_{$vo.name}_gzpcf_local');">
                          <input type="button" value="预览" class="layui-btn layui-btn-sm" onclick="BigImages($('#img_{$vo.fieldArr}_{$vo.name}_gzpcf_local').attr('src'));">
                          <input type="button" value="清除" class="layui-btn layui-btn-sm layui-btn-warm" data-inputid="{$vo.fieldArr}_{$vo.name}_gzpcf_local" onclick="DelImages(this);">
                        </div>
                      </li>
                    </ul>
                  </div>
                </div>
                <!-- 单张图 end -->
            {/case}

            {case value="imgs"}
                <!-- 多张图 start -->
                <div class="layui-form-item">
                    <label class="layui-form-label">{$vo.title}</label>
                    <div class="layui-input-inline layadmin-layer-demo">
                        <button class="layui-btn pcfcms-multi-upload layui-btn-sm fl" lay-data="{number:30,pcf_savepath:'allimg',pcf_callback:'{$vo.fieldArr}_{$vo.name}_call_back'}" style="margin-right:10px;"><i class="layui-icon">&#xe67c;</i>上传图片</button>
                        <button class="layui-btn layui-btn-sm fl" onClick="GetPictureFolder(30,'{$vo.fieldArr}_{$vo.name}','{$vo.fieldArr}_{$vo.name}_call_back');"><i class="layui-icon">&#xe64a;</i>图库</button>
                    </div>
                </div>
                <div class="layui-form-item {if empty($vo[$vo['name'].'_gzpcf_imgupload_list'])}none{/if}" id="dl_{$vo.fieldArr}_{$vo.name}">
                    <label class="layui-form-label"></label>
                    <div class="layui-upload-list sort-list-{$vo.fieldArr}_{$vo.name}" id="{$vo.fieldArr}_{$vo.name}_upload_tpl" style="margin-top:0px;margin-bottom:10px;">
                        {volist name="$vo[$vo['name'].'_gzpcf_imgupload_list']" id="v2" key="k2"}
                        <div id="tpcf_{$k2}" class="icaction">
                        <input type="hidden" name="{$vo.fieldArr}[{$vo.name}][]" value="{$v2}">
                        <img class="layui-upload-img" width="92px" height="92px" src="{$v2}">
                        <a class="del-bt" href="javascript:void(0);" style="color:white;" onclick="{$vo.fieldArr}_{$vo.name}_ClearPicArr22(this);" data-src="{$v2}" data-ppd="pcf_{$k2}">删除</a>
                        </div>
                        {/volist}
                    </div>
                </div>
                <style type="text/css" media="screen">
                    .icaction{width:92px;height:92px;float:left;margin-right:5px;}
                    .icaction .del-bt{position:relative;top:-20px;display:block;height:20px;line-height:20px;width:92px;text-align:center;z-index:999;background-color:rgba(0,0,0,0.5);}
                </style>
                <script type="text/javascript">
                    // 上传多图回调函数
                    function {$vo.fieldArr}_{$vo.name}_call_back(pathObj){
                        if (Array.isArray(pathObj)){
                            var paths = pathObj;
                        }else{
                            var paths = [pathObj.url];
                        }
                        $("#dl_{$vo.fieldArr}_{$vo.name}").show();
                        for (var i=0;i<paths.length ;i++ ){
                            var html = '<div id="tpcf_'+i+'" class="icaction">';
                            html+='<input type="hidden" name="{$vo.fieldArr}[{$vo.name}][]" value="'+paths[i]+'">';
                            html+='<img src="'+paths[i]+'" class="layui-upload-img" width="92px" height="92px">';
                            html+='<a class="del-bt" href="javascript:void(0);" style="color:white;" onclick="{$vo.fieldArr}_{$vo.name}_ClearPicArr22(this);" data-src="'+paths[i]+'" data-ppd="pcf_'+i+'">删除</a>';
                            html+='</div>';
                            $(html).appendTo($("#{$vo.fieldArr}_{$vo.name}_upload_tpl"));
                        }
                    }
                    // 上传之后删除组图input
                    function {$vo.fieldArr}_{$vo.name}_ClearPicArr22(obj){
                        var path = $(obj).attr('data-ppd');
                        $("#t"+path).remove();
                        var pcf = document.getElementById("{$vo.fieldArr}_{$vo.name}_upload_tpl").innerText;
                        if(!pcf){
                            var html = '<input type="hidden" name="{$vo.fieldArr}[{$vo.name}][]" value="">';
                            $(html).appendTo($("#{$vo.fieldArr}_{$vo.name}_upload_tpl"));
                        }
                    }
                    // 以下 产品相册的拖动排序相关
                    $( ".sort-list-{$vo.fieldArr}_{$vo.name}" ).sortable({
                        start: function( event, ui) {},
                        stop: function( event, ui ) {}
                    });
                    $( ".sort-list-{$vo.fieldArr}_{$vo.name}" ).disableSelection();
                </script>
                <!-- 多张图 end -->
            {/case}

            {case value="int"}
                <!-- 整数类型 start -->
                <div class="layui-form-item">
                    <label class="layui-form-label">{$vo.title}</label>
                    <div class="layui-input-inline">
                        <input type="text" value="{$vo.dfvalue|default='0'}" name="{$vo.fieldArr}[{$vo.name}]" id="{$vo.fieldArr}_{$vo.name}" placeholder="只允许纯数字" class="layui-input" onkeyup="this.value=this.value.replace(/[^0-9]/g,'');" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^0-9]/g,''));">
                    </div>
                </div>
                <!-- 整数类型 end -->
            {/case}

            {case value="float"}
                <!-- 小数类型 start -->
                <div class="layui-form-item">
                    <label class="layui-form-label">{$vo.title}</label>
                    <div class="layui-input-inline">
                        <input type="text" value="{$vo.dfvalue|default='0'}" name="{$vo.fieldArr}[{$vo.name}]" id="{$vo.fieldArr}_{$vo.name}" placeholder="允许带有小数点的数值" class="layui-input" onkeyup="this.value=this.value.replace(/[^0-9\.]/g,'');" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^0-9\.]/g,''));">
                    </div>
                </div>
                <!-- 小数类型 end -->
            {/case}

            {case value="decimal"}
                <!-- 金额类型 start -->
                <div class="layui-form-item">
                    <label class="layui-form-label">{$vo.title}</label>
                    <div class="layui-input-inline">
                        <input type="text" value="{$vo.dfvalue|default='0.00'}" name="{$vo.fieldArr}[{$vo.name}]" id="{$vo.fieldArr}_{$vo.name}" placeholder="允许带有小数点的数值" class="layui-input" onkeyup="this.value=this.value.replace(/[^0-9\.]/g,'');" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^0-9\.]/g,''));">
                    </div>
                </div>
                <!-- 金额类型 end -->
            {/case}

            {case value="datetime"}
                <!-- 日期和时间 start -->
                <div class="layui-form-item">
                    <label class="layui-form-label">{$vo.title}</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" name="{$vo.fieldArr}[{$vo.name}]" id="{$vo.fieldArr}_{$vo.name}" value="{$vo['dfvalue']}">
                    </div>
                </div>
                <script type="text/javascript">
                    $(function () {
                        laydate.render({
                          elem: '#{$vo.fieldArr}_{$vo.name}',
                          type: 'datetime'
                        });
                    });
                </script>
                <!-- 日期和时间 end -->
            {/case}





            {case value="htmltext"}
                <!-- HTML文本 start -->
                <div class="layui-form-item">
                    <label class="layui-form-label">{$vo.title}</label>
                    <div class="layui-input-block">
                        <textarea  class="ckeditor" id="{$vo.fieldArr}_{$vo.name}" data-func="{$vo.fieldArr}_{$vo.name}" name="{$vo.fieldArr}[{$vo.name}]">{$vo.dfvalue|raw}</textarea>
                        <p style="margin-top:10px;">
                        <a href="javascript:void(0);" onclick="remote_to_local_{$vo.fieldArr}_{$vo.name}();" class="layui-btn layui-btn-danger layui-btn-sm">远程图片本地化</a>
                        <a href="javascript:void(0);" onclick="replace_links_{$vo.fieldArr}_{$vo.name}();" class="layui-btn layui-btn-normal layui-btn-sm">清除非本站链接</a>
                        </p>
                    </div>
                </div>
                <script type="text/javascript">


                    var ueditor_toolbars = [[
                        'fullscreen', 'source', '|', 'undo', 'redo', '|',
                        'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', '|',
                        'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
                        'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
                        'directionalityltr', 'directionalityrtl', 'indent', '|',
                        'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
                        'link', 'unlink', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
                        'simpleupload', 'insertimage', 'emotion', 'insertvideo', 'attachment', 'map', 'insertframe', 'insertcode', '|',
                        'horizontal', 'spechars', '|',
                        'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
                        'preview', 'searchreplace', 'drafts'
                    ]];


                   UE.getEditor('{$vo.fieldArr}_{$vo.name}',{
                        serverUrl :"{:url('/ueditor/index',['savepath'=>'ueditor'])}",
                        zIndex: 9,
                        initialFrameWidth: "100%", //初化宽度
                        initialFrameHeight: 300, //初化高度            
                        focus: false, //初始化时，是否让编辑器获得焦点true或false
                        maximumWords: 99999,
                        removeFormatAttributes: 'class,style,lang,width,height,align,hspace,valign',//允许的最大字符数
                        pasteplain:false, //是否默认为纯文本粘贴
                        autoHeightEnabled: true,
                        toolbars: ueditor_toolbars
                    });

                    //必须在提交前渲染编辑器；
                    function {$vo.fieldArr}_{$vo.name}() {
                        if(UE.getEditor("{$vo.fieldArr}_{$vo.name}").queryCommandState('source') != 0) {
                            UE.getEditor("{$vo.fieldArr}_{$vo.name}").execCommand('source'); //切换到【设计】视图
                        }
                    }

                    // 远程图片本地化
                    function remote_to_local_{$vo.fieldArr}_{$vo.name}() {
                        var body = UE.getEditor("{$vo.fieldArr}_{$vo.name}").getContent();
                        layer.msg('正在处理请勿刷新页面', {icon: 16,shade: 0.01,time:3600000});
                        $.ajax({
                            type: 'POST',
                            url: "{:url('/ueditor/ajax_remote_to_local')}",
                            data: {body:body},
                            dataType: "JSON",
                            success: function(res){
                                layer.closeAll();
                                if (res.status) {
                                    UE.getEditor("{$vo.fieldArr}_{$vo.name}").setContent(res.body);
                                    layer.msg(res.msg, {icon: 1, time:1000});
                                } else {
                                    layer.msg(res.msg, {icon: 2, time:1000});
                                }
                            },
                            error: function(e){
                                layer.closeAll();
                                layer.msg("未知错误，请求中断！", {icon: 2, time:1000});
                            }
                        });
                    }
                    // 清除非本站链接
                    function replace_links_{$vo.fieldArr}_{$vo.name}() {
                        var body = UE.getEditor("{$vo.fieldArr}_{$vo.name}").getContent();
                        layer.msg('正在处理请勿刷新页面', {icon: 16,shade: 0.01,time:3600000});
                        $.ajax({
                            type: 'POST',
                            url: "{:url('/ueditor/ajax_replace_links')}",
                            data: {body:body},
                            dataType: "JSON",
                            success: function(res){
                                layer.closeAll();
                                if (res.status) {
                                    UE.getEditor("{$vo.fieldArr}_{$vo.name}").setContent(res.body);
                                    layer.msg(res.msg, {icon: 1, time:1000});
                                } else {
                                    layer.msg(res.msg, {icon: 2, time:1000});
                                }
                            },
                            error: function(e){
                                layer.closeAll();
                                layer.msg("未知错误，请求中断！", {icon: 2, time:1000});
                            }
                        });
                    }
                </script>
                <!-- HTML文本 end -->
            {/case}


            <!--{case value="htmltext1111"}
                <div class="layui-form-item">
                    <label class="layui-form-label">{$vo.title}</label>
                    <div class="layui-input-block">
                    <textarea id="editor" name="{$vo.name}" class="ckeditor">{$vo.dfvalue|raw}</textarea>
                    <script type="text/javascript">
                        (function(){ 
                            $.getEditor("editor"); 
                        })();
                    </script>
                    </div>
                </div>
            {/case}-->


        {/switch}
    {/if}
{/volist}